import request from "@/utils/request.js";



/**
 * 查询科普管理列表
 * @param query
 * @returns {*}
 */

export const listPopularize = (query) => {
	return request({
		url: '/system/popularize/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询科普管理详细
 * @param id
 */
export const getPopularize = (id) => {
	return request({
		url: '/system/popularize/' + id,
		method: 'get'
	});
};

/**
 * 获取所有学校列表
 * @param query
 * @returns {*}
 */

export const optionSchool = (query) => {
	return request({
		url: '/system/dept/optionSchool',
		method: 'get',
		params: query
	});
};

/**
 * 获取所有练习题
 * @param id
 */
export const practiceList = () => {
	return request({
		url: '/system/question/practiceList',
		method: 'get'
	});
};

/**
 * 是否有题
 * @param id
 */
export const hasQuestion = () => {
	return request({
		url: '/system/question/hasQuestion',
		method: 'get'
	});
};

/**
 * 获取等级测试信息
 * @param id
 */
export const checkTestLevel = () => {
	return request({
		url: '/system/question/checkTestLevel',
		method: 'get'
	});
};

/**
 * 获取所有升级题
 * @param id
 */
export const testLevel = () => {
	return request({
		url: '/system/question/testLevel',
		method: 'get'
	});
};

/**
 * 获取所有练习数量
 * @param id
 */
export const getPracticeNum = () => {
	return request({
		url: '/system/question/getPracticeNum',
		method: 'get'
	});
};

/**
 * 新增/修改用户圈子分类
 * @param id
 */
export const editCircleCategory = (data) => {
	return request({
		url: '/system/user/editCircleCategory',
		method: 'post',
		data
	});
};

/**
 * 提交问题答案
 * @param id
 */
export const finishPractice = (data) => {
	return request({
		url: '/system/question/finishPractice',
		method: 'post',
		data
	});
};

/**
 * 提交升级答案
 * @param id
 */
export const finishTestLevel = (data) => {
	return request({
		url: '/system/question/finishTestLevel',
		method: 'post',
		data
	});
};


/**
 * 错题列表
 * @param id
 */
export const getIncorrect = (data) => {
	return request({
		url: '/system/question/getIncorrect',
		method: 'get',
		params: data
	});
};

/**
 * 圈子列表
 * @param id
 */
export const circleList = (data) => {
	return request({
		url: '/system/circle/list',
		method: 'get',
		params: data
	});
};
/**
 * 我的圈子
 * @param id
 */
export const circlemyList = (data) => {
	return request({
		url: '/system/circle/myList',
		method: 'get',
		params: data
	});
};


/**
 * 全部科普筛选
 * @param id
 */
export const getCircleByUserId = (data) => {
	return request({
		url: '/system/user/getCircleByUserId',
		method: 'get',
		params: data
	});
};

/**
 * 新增圈子
 * @param data
 */
export const addCircle = (data) => {
	return request({
		url: '/system/circle',
		method: 'post',
		data: data
	});
};

/**
 * 圈子详情
 * @param data
 */
export const circleId = (id) => {
	return request({
		url: '/system/circle/' + id,
		method: 'get',
	});
};


/**
 * 我的积分
 * @param id
 */
export const pointsList = (data) => {
	return request({
		url: '/system/points/list',
		method: 'get',
		params: data
	});
};
/**
 * 新增圈子收藏
 * @param data
 */
export const collectAdd = (data) => {
	return request({
		url: '/system/collect/add',
		method: 'post',
		data: data
	});
};
/**
 * 新增科普收藏
 * @param data
 */
export const addCollectByPopularize = (data) => {
	return request({
		url: '/system/collect/addCollectByPopularize',
		method: 'post',
		data: data
	});
};
/**
 * 删除收藏
 * @param data
 */
export const collectDelete = (data) => {
	return request({
		url: '/system/collect/delete',
		method: 'post',
		data: data
	});
};
/**
 * 我的收藏
 * @param id
 */
export const collectList = (data) => {
	return request({
		url: '/system/collect/list',
		method: 'get',
		params: data
	});
};
/**
 * ai
 * @param id
 */
export const callWithMessage = (data) => {
	return request({
		url: '/system/tongYi/callWithMessage',
		method: 'post',
		data: data
	});
};

/**
 * 修改个人信息
 * @param id
 */
export const updateUserInfo = (data) => {
	return request({
		url: '/system/user/profile/updateUserInfo',
		method: 'post',
		data: data
	});
};
/**
 * 修改个人信息
 * @param id
 */
export const getLearningSituation = (data) => {
	return request({
		url: '/system/question/getLearningSituation',
		method: 'get',
		data: data
	});
};
/**
 * 成为会员
 * @param id
 */
export const openVip = (data) => {
	return request({
		url: '/system/vipOrder/openVip',
		method: 'post',
		data: data
	});
};
/**
 * 查看我的纠错
 * @param id
 */
export const errormyList = (data) => {
	return request({
		url: '/system/djjError/myList',
		method: 'get',
		data: data
	});
};
/**
 * 我要纠错
 * @param id
 */
export const djjError = (data) => {
	return request({
		url: '/system/djjError',
		method: 'post',
		data: data
	});
};
/**
 * 下载列表
 * @param id
 */
export const downloadList = (data) => {
	return request({
		url: '/system/download/list',
		method: 'get',
		data: data
	});
};
/**
 * 所属等级
 * @param id
 */
export const listUserLevel = (query) => {
	return request({
		url: '/system/userLevel/list',
		method: 'get',
		params: query
	});
};

/**
* 新增答题信息
* @param data
*/
export const addQuestion = (data) => {
	return request({
		url: '/system/question/addByStudent',
		method: 'post',
		data: data
	});
};

/**
* 查询答题信息列表
* @param data
*/
export const questionmyList = (data) => {
	return request({
		url: '/system/question/myList',
		method: 'get',
		params: data
	});
};


/**
* 活动报名
* @param data
*/
export const activitylist = (data) => {
	return request({
		url: '/system/activity/list',
		method: 'get',
		params: data
	});
};

/**
* 活动报名详情
* @param data
*/
export const activitylistId = (id) => {
	return request({
		url: '/system/activity/' + id,
		method: 'get',
	});
};

/**
* 消息
* @param data
*/
export const noticeList = (params) => {
	return request({
		url: '/system/notice/list',
		method: 'get',
		params
	});
};
/**
* 消息详情
* @param data
*/
export const noticeId = (id) => {
	return request({
		url: '/system/notice/' + id,
		method: 'get',
	});
};
/**
* 新增活动报名
* @param data
*/
export const activityOrder = (data) => {
	return request({
		url: '/system/activityOrder',
		method: 'post',
		data: data
	});
};

/**
 * 新增圈子回复
 * @param data
 */
export const addCircleReply = (data) => {
	return request({
		url: '/system/circleReply',
		method: 'post',
		data: data
	});
};

/**
 * 查询竞赛管理列表
 * @param query
 * @returns {*}
 */

export const listCompetition = (query) => {
	return request({
		url: '/system/competition/list',
		method: 'get',
		params: query
	});
};

/**
* 报名
* @param data
*/
export const competitionApply = (data) => {
	return request({
		url: '/system/competition/apply',
		method: 'post',
		data: data
	});
};

/**
* 我的竞赛
* @param data
*/
export const competitionjoined = (data) => {
	return request({
		url: '/system/competition/joined',
		method: 'get',
		params: data
	});
};

/**
* 我的 竞赛开始考试入口
* @param data
*/
export const competitionnotStart = (data) => {
	return request({
		url: '/system/competition/notStart',
		method: 'get',
		params: data
	});
};

/**
* 我的 开始竞赛
* @param data
*/
export const competitionnStart = (data) => {
	return request({
		url: '/system/competition/start',
		method: 'post',
		data: data
	});
};
/**
* 我的 开始竞赛 提交答案
* @param data
*/
export const competitionnFinish = (data) => {
	return request({
		url: '/system/competition/finish',
		method: 'post',
		data: data
	});
};
/**
* 竞赛详情
* @param data
*/
export const competitionId = (id) => {
	return request({
		url: '/system/competition/' + id,
		method: 'get',
	});
};
/**
* 我的 我的点亮
* @param data
*/
export const myLight = (data) => {
	return request({
		url: '/system/user/myLight',
		method: 'get',
		params: data
	});
};
/**
* 二维码地址
* @param data
*/
export const getQrs = () => {
	return request({
		url: '/system/down/1924448101794566145',
		method: 'get',
	});
};

/**
 * 查询新闻管理列表
 * @param query
 * @returns {*}
 */

export const listNews = (query?: any) => {
	return request({
		url: '/system/news/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询新闻管理详细
 * @param id
 */
export const getNews = (id: any) => {
	return request({
		url: '/system/news/' + id,
		method: 'get'
	});
};


/** 升级资格
 * @param data
 */
export const hasUpgradeQuestion = (data) => {
	return request({
		url: '/system/question/hasUpgradeQuestion',
		method: 'get',
		params: data
	});
};

/** 升级资格
 * @param data
 */
export const upgradeList = (data) => {
	return request({
		url: '/system/question/upgradeList',
		method: 'get',
		params: data
	});
};

/**
 * 提交升级答案
 * @param id
 */
export const upgradeAnswer = (data) => {
	return request({
		url: '/system/question/upgradeAnswer',
		method: 'post',
		data
	});
};














// 获取供应商信息
export function getSupplierList(data) {
	return request({
		url: "/basic/hmSupplier/list",
		method: "get",
		data,
	});
}
//获取合同信息 供销 破价 保证金
export function getContractList(data) {
	return request({
		url: "/basic/contract/list",
		method: "get",
		data,
	});
}
// 获取合同信息详细信息
export function getcontract(data) {
	return request({
		url: "/basic/contract/" + data,
		method: "get",
		data,
	});
}

// * 查询商品列表
export function listSupplierAddProduct(data) {
	return request({
		url: "/supplier/hmProducts/list",
		method: "post",
		params: data,
	});
}
// 查询商品详细
export function getSupplierAddProducts(data) {
	return request({
		url: "/supplier/hmProducts/" + data,
		method: "get",
		data,
	});
}
// 查询供应商增类列表
export function hmSupplierList(data) {
	return request({
		url: "/basic/hmSupplier/list",
		method: "get",
		data,
	});
}

// 查询OSS对象基于id串
export function listByIds(data) {
	return request({
		url: "/resource/oss/listByIds/" + data,
		method: "get",
		data,
	});
}
//查询品牌列表
export function listBrand(data) {
	return request({
		url: "/basic/brand/list",
		method: "get",
		data,
	});
}
// 获取品牌详细信息
export function getbrandId(data) {
	return request({
		url: "/basic/brand/" + data,
		method: "get",
		data,
	});
}
// 查询供应商列表
export function hmSupplierMyList(data) {
	return request({
		url: "/basic/hmSupplier/my/list",
		method: "get",
		data,
	});
}

// 根据字典类型查询字典数据信息
export function getDicts(data) {
	return request({
		url: "/system/dict/data/type/" + data,
		method: "get",
		data,
	});
}
//类目：根据父级代码获取子类
export function getproductscategorychildlistbypid(data) {
	return request({
		url: "/basic/productsCategory/getproductscategorychildlistbypid",
		method: "get",
		data,
	});
}
// 新增商品提报
export function addHmProducts(data) {
	return request({
		url: "/supplier/hmProducts",
		method: "post",
		data,
	});
}
//获取所有主播
export function getAnchorList(data) {
	return request({
		url: "/system/user/list",
		method: "get",
		data,
	});
}
//修改商品状态为已到样
export function editTwo(data) {
	return request({
		url: "/basic/hmProducts/editTwo",
		method: "get",
		data,
	});
}
// 修改商品为待上架
export function editFour(data) {
	return request({
		url: "/basic/hmProducts/editFour",
		method: "get",
		data,
	});
}
// 修改商品为已上架
export function editFive(data) {
	return request({
		url: "/basic/hmProducts/editFive",
		method: "get",
		data,
	});
}
// 修改商品为下架
export function editOff(data) {
	return request({
		url: "/basic/hmProducts/editOff?ids=" + data,
		method: "get",
		data,
	});
}

export function editCore(data) {
	return request({
		url: "/basic/hmProducts/core",
		method: "post",
		data,
	});
}
//修改商品为待审核
export function editSeven(data) {
	return request({
		url: "/basic/hmProducts/editSeven",
		method: "get",
		data,
	});
}
// 新增品牌
export function addBrand(data) {
	return request({
		url: "/basic/brand",
		method: "post",
		data,
	});
}
//查询品牌列表
export function getbrandList(data) {
	return request({
		url: "/basic/brand/list",
		method: "get",
		data,
	});
}
export function editHmProducts(data) {
	return request({
		url: "/basic/hmProducts",
		method: "put",
		data,
	});
}
//修改品牌
export function updatebrand(data) {
	return request({
		url: "/basic/brand",
		method: "put",
		data,
	});
}
//修改账号信息
export function updateHmSupplier(data) {
	return request({
		url: "/basic/hmSupplier",
		method: "put",
		data,
	});
}

// 新增供应商账号
export function addHmSuppliers(data) {
	return request({
		url: "/system/add",
		method: "post",
		data,
	});
}

// 获取供应商信息
export function getSupplierId(data) {
	return request({
		url: "/supplier/getInfo",
		method: "post",
		data
	});
}

// 获取部门列表
export function getDeptList(data) {
	return request({
		url: "/supplier/passer/list",
		method: "post",
		params: data,
	});
}
//获取部门下的所有用户信息
export function getUserList(data) {
	return request({
		url: "/supplier/passer/getUserList",
		method: "post",
		params: data,
	});
}

//商品编辑详细
export function hmSupplierDeail(data) {
	return request({
		url: "/basic/hmSupplier/list",
		method: "get",
		data,
	});
}

// 修改商品为已邮寄中状态
export function editOne(data) {
	return request({
		url: "/supplier/hmProducts/editOne",
		method: "post",
		data,
	});
}

export function getSupplierIdByToken(data) {
	return request({
		url: "/basic/hmSupplier/getSupplierIdByToken",
		method: "post",
		data,
	});
}

// 获取验证码
export function getPhoneCode(data) {
	return request({
		url: "/system/sms/sendCode",
		method: "post",
		params: data,
	});
}

// 找回密码发送手机验证码
export function findPasswordCode(data) {
	return request({
		url: "/system/findPasswordCode",
		method: "post",
		params: data,
	});
}

// 找回密码手机验证码验证
export function findPasswordCheckCode(data) {
	return request({
		url: "/system/findPasswordCheckCode",
		method: "post",
		params: data,
	});
}

// 手机号找回密码
export function resetUserPwd(data) {
	return request({
		url: "/system/resetUserPwd",
		method: "post",
		params: data,
	});
}

// 修改密码
export function updatePassword(data) {
	return request({
		url: "/system/updatePassword",
		method: "post",
		params: data,
	});
}

// 隐私政策
export function listNotice(data) {
	return request({
		url: "/system/notice/list",
		method: "get",
		params: data,
	});
}

// 解析手机号
export function encrypt(data) {
	return request({
		url: "/system/phoneNumber",
		method: "post",
		params: data,
	});
}

// 获取用户详细信息
export const getInfo = () => {
	return request({
		url: "/system/user/getInfo",
		method: "get",
	});
};

// 添加商品获取招商部
export const getSupplier = () => {
	return request({
		url: "/supplier/getSupplier",
		method: "post"
	});
};

// 添加商品获取招商员
export const getUserById = (data) => {
	return request({
		url: "/supplier/getUserById",
		method: "post",
		params: data,
	});
};

/**
 * 类目根据id查询pid
 * @param data
 * @returns
 */
export const getListById = (data) => {
	return request({
		url: "/basic/productsCategory/getListById",
		method: "post",
		data: data,
	});
};

// 查询商品类目-改造后
export const categoryList = (data) => {
	return request({
		url: "/basic/category/list",
		method: "post",
		data,
	});
};

// 发货方式
export const hmExpress = () => {
	return request({
		url: "/system/dict/data/type/hm_express",
		method: "get",
	});
};

// 请求oss配置
export const getAliOssSts = () => {
	return request({
		url: "/system/client/getAliOssSts",
		method: "get",
	});
};

/**
 * 快递信息识别
 * @param data
 */
export const getDeliveryInfo = (data) => {
	return request({
		url: '/basic/delivery/getDeliveryInfo',
		method: 'post',
		data: data,
	});
};


